package ro.sep.web.dao.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import ro.sep.web.services.model.SearchResult;

public class SearchResultMapper implements RowMapper<SearchResult> {

	@Override
	public SearchResult mapRow(ResultSet rs, int row) throws SQLException {
		SearchResult searchResult = new SearchResult();
		searchResult.setProductid(rs.getInt("productId"));
		searchResult.setProductName(rs.getString("productName"));
		searchResult.setDescription(rs.getString("description"));
		searchResult.setPrice(rs.getBigDecimal("price"));
		searchResult.setUrl(rs.getString("url"));
		return searchResult;
	}

}
